<%@ page import="com.hnluchuan.staff.dto.EmergencyContactDTO" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<%@include file="/common/head.jsp" %>
<%--<c:set var="module" value="employee"/>--%>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <form action="${ctx }/admin/employee/save?id=${n.id }" id="detail-form" class="form-horizontal"  method="post">
        <input type="hidden" name="_token" value="${_token }"/>
       <%-- <div class="form-group">
            <!-- 用户ID -->
            &lt;%&ndash;
                             <label class="col-sm-2 control-label">用户ID</label>
            &ndash;%&gt;
            <div class="col-sm-4" style="display:none" >
                <input type="hidden" id="user-id" name="user.id" value="${n.user.id }" class="form-control">
                <input type="text"  placeholder="请选择用户ID" class="form-control" id="user-name" value="${n.user.id }"
                       onclick="bring({
                               url:'${ctx}/admin/user/search',
                               name: 'id',
                               idInput: 'user-id',
                               nameInput: 'user-name'
                               })"/>

            </div>
        </div>--%>
        <div class="form-group">
            <label class="col-sm-2 control-label">岗位</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="position" id="position" value="${n.position}">
            </div>
            <label class="col-sm-2 control-label">姓名</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="name" id="name" value="${n.name}">
            </div>
        </div>
        <div class="form-group">
            <!-- 出生日期 -->
            <label class="col-sm-2 control-label">出生日期</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="birth" id="birth" value="<fmt:formatDate value='${n.birth }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: 'YYYY-MM-DD'})">
            </div>

            <!-- 性别 -->
            <label class="col-sm-2 control-label">性别</label>
            <div class="col-sm-4">
                <select class="form-control" name="sex" value="${n.sex }">
                    <option value="1" <c:if test="${'1' eq n.sex }">selected</c:if>>男</option>
                    <option value="2" <c:if test="${'2' eq n.sex }">selected</c:if>>女</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <!-- 身高 -->
            <label class="col-sm-2 control-label">身高</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="height" id="height" value="${n.height }">cm
            </div>

            <!-- 体重 -->
            <label class="col-sm-2 control-label">体重</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="weight" id="weight" value="${n.weight }">kg
            </div>
        </div>
        <div class="form-group">
            <!-- 籍贯 -->
            <label class="col-sm-2 control-label">籍贯</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="place" id="place" value="${n.place }">
            </div>

            <!-- 民族 -->
            <label class="col-sm-2 control-label">民族</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="nation" value="${n.nation }">
            </div>
        </div>
        <div class="form-group">
            <!-- 联系电话 -->
            <label class="col-sm-2 control-label">联系电话</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="phone" id="phone" value="${n.phone }">
            </div>

            <!-- 身份证号 -->
            <label class="col-sm-2 control-label">身份证号</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="ID_card" id="ID_card" value="${n.ID_card }">
            </div>
        </div>
        <div class="form-group">

            <!-- 毕业学校 -->
            <label class="col-sm-2 control-label">毕业学校</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="school" value="${n.school }">
            </div>

            <!-- 专业 -->
            <label class="col-sm-2 control-label">专业</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="major" value="${n.major }">
            </div>
        </div>
        <div class="form-group">
            <!-- 学历 -->
            <label class="col-sm-2 control-label">学历</label>
            <div class="col-sm-4">
                <select class="form-control" name="education" value="${n.education }">
                    <option value="1" <c:if test="${'1' eq n.education }">selected</c:if>>大专</option>
                    <option value="2" <c:if test="${'2' eq n.education }">selected</c:if>>本科</option>
                    <option value="3" <c:if test="${'3' eq n.education }">selected</c:if>>其他</option>
                </select>
            </div>

            <!-- 户口所在地 -->
            <label class="col-sm-2 control-label">户口所在地</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="location" value="${n.location }">
            </div>
        </div>
        <div class="form-group">
            <!-- 居住地址 -->
            <label class="col-sm-2 control-label">居住地址</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="address" value="${n.address }">
            </div>

            <!-- 微信号 -->
            <label class="col-sm-2 control-label">微信号</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="wechat" value="${n.wechat }">
            </div>
        </div>
        <div class="form-group">
            <!-- 邮箱 -->
            <label class="col-sm-2 control-label">邮箱</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="email"  id="email" value="${n.email }">
            </div>

            <!-- 婚姻状况 -->
            <label class="col-sm-2 control-label">婚姻状况</label>
            <div class="col-sm-4">
                <select class="form-control" name="marry" value="${n.marry }">
                    <option value="1" <c:if test="${'1' eq n.marry }">selected</c:if>>未婚</option>
                    <option value="2" <c:if test="${'2' eq n.marry}">selected</c:if>>已婚</option>
                </select>
            </div>
        </div>
        <div class="form-group">
         <!-- 入职时间 -->
            <label class="col-sm-2 control-label">入职时间</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="in_time" value="<fmt:formatDate value='${n.in_time}' pattern='yyyy-MM-dd'/>" onclick="laydate({format: 'YYYY-MM-DD'})">
            </div>

           <%--<!-- 员工状态/1.录用/2.停职 -->
            <label class="col-sm-2 control-label">员工状态</label>
            <div class="col-sm-4">
                <select class="form-control" name="status" value="${enum:detail('EmployeeStatus', 'status', n.status)}">
                </select>
            </div>--%>
        </div>

        <div>
            <hr style="height:2px;border:black;border-top:2px ridge green;" />
        </div>
        <p align="center"><b>紧急联系人</b></p>
        <fieldset id="fd1">
        <div data-type="tab1">
            <c:forEach items="${em}" var="em">
        <div class="form-group">
            <!-- 姓名 -->
            <label class="col-sm-2 control-label">姓名</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="contartName" id="contartName" value="${em.contartName }">
            </div>

            <!-- 关系 -->
            <label class="col-sm-2 control-label">关系</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="contartRelation" value="${em.contartRelation }">
            </div>
        </div>
        <div class="form-group">

            <!-- 联系电话 -->
            <label class="col-sm-2 control-label">联系电话</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="contartPhone"  id="contartPhone" value="${em.contartPhone}">
            </div>

            <!-- 单位或住址 -->
            <label class="col-sm-2 control-label">单位或住址</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="contartAddress" value="${em.contartAddress}">
            </div>
        </div>
            </c:forEach>
            </div>
        </fieldset>

        <%--克隆的方法--%>
        <%--<div class="form-group">
            <label class="col-sm-2 control-label">
                <button type="button" class="btn btn-sm btn-outline btn-primary" onclick="$('#fd1').append($('div[data-type=tab1]:eq(0)').clone());"><i class="fa fa-plus"></i> 新增</button>
            </label>
        </div>--%>

        <%--下划线--%>
        <div>
            <hr style="height:2px;border:black;border-top:2px ridge green;" />
        </div>

        <p align="center"><b>教育及培训情况</b></p>
        <fieldset id="fd2">
        <div data-type="tab2">
            <c:forEach items="${ed}" var="ed">
        <div class="form-group">
            <!-- 学习起始时间 -->
            <label class="col-sm-2 control-label">学习起始时间</label>
            <div class="col-sm-4">

                <input type="text" class="form-control" name="start" id="educastart" value="<fmt:formatDate value='${ed.educastart }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: 'YYYY-MM-DD'})">
            </div>

            <!-- 学习结束时间 -->
            <label class="col-sm-2 control-label">学习结束时间</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="educaend" value="<fmt:formatDate value='${ed.educaend }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: 'YYYY-MM-DD'})">
            </div>
        </div>
        <div class="form-group">

            <!-- 专业 -->
            <label class="col-sm-2 control-label">专业</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="educaMajor" value="${ed.educaMajor}">
            </div>

            <!-- 学历 -->
            <label class="col-sm-2 control-label">学历</label>
            <div class="col-sm-4">
                <select type="text" class="form-control" name="educarecord" value="${ed.educarecord }">
                    <option value="1" <c:if test="${'1' eq ed.educarecord  }">selected</c:if>>大专</option>
                    <option value="2" <c:if test="${'2' eq ed.educarecord  }">selected</c:if>>本科</option>
                    <option value="3" <c:if test="${'3' eq ed.educarecord  }">selected</c:if>>其他</option>
                </select>

            </div>
        </div>

        <div class="form-group">
            <!-- 证书 -->
            <label class="col-sm-2 control-label">证书</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="certificate" value="${ed.certificate }">
            </div>
        </div>
            </c:forEach>
         </div>
        </fieldset>
        <%--克隆的方法--%>
        <%--<div class="form-group">
            <label class="col-sm-2 control-label">
                <button type="button" class="btn btn-sm btn-outline btn-primary" onclick="$('#fd2').append($('div[data-type=tab2]:eq(0)').clone());"><i class="fa fa-plus"></i> 新增</button>
            </label>
        </div>--%>
        <%--下划线--%>
        <div>
            <hr style="height:2px;border:black;border-top:2px ridge green;" />
        </div>
        <p align="center"><b>工作经验管理</b></p>
        <fieldset id="fd3">
            <div data-type="tab3">
                <c:forEach items="${ex}" var="ex">
                <div class="form-group">

                    <!-- 单位 -->
                    <label class="col-sm-2 control-label">单位</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="company" id="company" value="${ex.company }">
                    </div>

                    <!-- 工作 -->
                    <label class="col-sm-2 control-label">工作</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="work" value="${ex.work }">
                    </div>
                </div>
                <div class="form-group">

                    <!-- 职位 -->
                    <label class="col-sm-2 control-label">职位</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="exposition" value="${ex.exposition }">
                    </div>

                    <!-- 离职原因 -->
                    <label class="col-sm-2 control-label">离职原因</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="reason" value="${ex.reason }">
                    </div>
                </div>
                <div class="form-group">
                    <!-- 工作起始时间 -->
                    <label class="col-sm-2 control-label">工作起始时间</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="workstart" value="<fmt:formatDate value='${ex.workstart }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: 'YYYY-MM-DD'})">
                    </div>

                    <!-- 工作结束时间 -->
                    <label class="col-sm-2 control-label">工作结束时间</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="workend" value="<fmt:formatDate value='${ex.workend}' pattern='yyyy-MM-dd'/>" onclick="laydate({format: 'YYYY-MM-DD'})">
                    </div>
                </div>
                </c:forEach>
            </div>
        </fieldset>
        <%--<div class="form-group">
            <label class="col-sm-2 control-label">
                <button type="button" class="btn btn-sm btn-outline btn-primary" onclick="$('#fd3').append($('div[data-type=tab3]:eq(0)').clone());"><i class="fa fa-plus"></i> 新增</button>
            </label>
        </div>--%>

        <%--下划线--%>
        <div>
            <hr style="height:2px;border:black;border-top:2px ridge green;" />
        </div>
        <p align="center"><b>家庭联系人</b></p>
        <fieldset id="fd4">
            <div data-type="tab4">
                <c:forEach items="${fa}" var="fa">
                <div class="form-group">
                    <!-- 姓名 -->
                    <label class="col-sm-2 control-label">姓名</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="familyname" value="${fa.familyname }">
                    </div>
                    <!-- 关系 -->
                    <label class="col-sm-2 control-label">关系</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="familyRelation" value="${fa.familyRelation}">
                    </div>
                </div>
                <div class="form-group">

                    <!-- 联系方式 -->
                    <label class="col-sm-2 control-label">联系方式</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="contact" value="${fa.contact }">
                    </div>

                    <!-- 年龄 -->
                    <label class="col-sm-2 control-label">年龄</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="familyage" value="${fa.familyage}">
                    </div>
                </div>
                <div class="form-group">
                    <!-- 工作单位 -->
                    <label class="col-sm-2 control-label">工作单位</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="familycompany" value="${fa.familycompany}">
                    </div>

                    <!-- 职位 -->
                    <label class="col-sm-2 control-label">职位</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="familyposition" value="${fa.familyposition}">
                    </div>
                </div>
                </c:forEach>
            </div>
        </fieldset>
       <%-- <div class="form-group">
            <label class="col-sm-2 control-label">
                <button type="button" class="btn btn-sm btn-outline btn-primary" onclick="$('#fd4').append($('div[data-type=tab4]:eq(0)').clone());"><i class="fa fa-plus"></i> 新增</button>
            </label>
        </div>--%>
    </form>
</div>

    <%@include file="/common/foot.jsp" %>

</body>
</html>
